package com.itfitness.lifecycledemo;

import android.util.Log;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

/**
 * @ProjectName: LifeCycleDemo
 * @Package: com.itfitness.lifecycledemo
 * @ClassName: VideoPlayer
 * @Description: java类作用描述
 * @Author: 作者名
 * @CreateDate: 2021/9/14 20:13
 * @UpdateUser: 更新者：
 * @UpdateDate: 2021/9/14 20:13
 * @UpdateRemark: 更新说明：
 */
public class VideoPlayer implements LifecycleObserver {
    private static final String TAG = "VideoPlayer";
    /**
     * 开始播放视频
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    public void start(){
        Log.e(TAG,"开始播放视频");
    }

    /**
     * 暂停播放视频
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    public void pause(){
        Log.e(TAG,"暂停播放视频");
    }

    /**
     * 停止播放视频
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    public void stop(){
        Log.e(TAG,"停止播放视频");
    }
}
